import React from 'react';
import Hello from './hello'
import './App.css';

class App extends React.Component<any,any>{

  constructor(props: any) {
    super(props)
    this.state = {
      has: true
    }
  }

  handleClick(){
    let has=this.state.has?false:true
    this.setState({has})
  }
  render() {

    return (
      <div>
       {this.state.has&&<Hello ></Hello>} 
       <button onClick={this.handleClick.bind(this)}>切换子元素</button>
      </div>
    )
  }
}

export default App;
